package pe.com.rimac.portal.util.url;

import java.util.Map;

import javax.portlet.PortletException;
import javax.portlet.PortletRequest;
import javax.portlet.PortletResponse;

import com.ibm.portal.ObjectID;
import com.ibm.portal.state.EngineURL;

public interface UrlService 
{
    /**
     * Creates a new Single Portlet Refresh render URL.
     */
    EngineURL createSingleRenderURL(PortletRequest request, PortletResponse response, Map renderParams)
        throws PortletException;
    
    /**
     * Creates a new Single Portlet Refresh action URL.
     */
    EngineURL createSingleActionURL(PortletRequest request, PortletResponse response, Map actionParams)
        throws PortletException;
    
    /**
     * Creates a new Single Portlet Refresh URL.
     */    
    EngineURL createSingleURL(PortletRequest request, PortletResponse response, Map params, UrlType type)
        throws PortletException;    
    
    /**
     * Creates a new Single Portlet render URL.
     */
    EngineURL createSingleRenderURL(PortletRequest request, PortletResponse response, String pageUniqueName,
            String layoutUniqueName, Map actionParams) throws PortletException;
    
    /**
     * Creates a new Single Portlet action URL.
     */
    EngineURL createSingleActionURL(PortletRequest request, PortletResponse response, String pageUniqueName,
            String layoutUniqueName, Map actionParams) throws PortletException;
    
    EngineURL createSingleURL(PortletRequest request, PortletResponse response, String pageUniqueName,
            String layoutUniqueName, Map params, UrlType type) throws PortletException;    
    
    /**
     * Creates a new Portlet render URL.
     */    
    EngineURL createRenderURL(PortletRequest request, PortletResponse response, ObjectID pageOID,
            ObjectID layoutOID, Map actionParams) throws PortletException;
    
    /**
     * Creates a new Portlet render URL.
     */
    EngineURL createRenderURL(PortletRequest request, PortletResponse response, String pageUniqueName,
            String layoutUniqueName, Map actionParams) throws PortletException;

    /**
     * Creates a new Portlet action URL.
     */
    EngineURL createActionURL(PortletRequest request, PortletResponse response, ObjectID pageOID,
            ObjectID layoutOID, Map actionParams) throws PortletException;
    
    /**
     * Creates a new Portlet action URL.
     */
    EngineURL createActionURL(PortletRequest request, PortletResponse response, String pageUniqueName,
            String layoutUniqueName, Map actionParams) throws PortletException;
    
    /**
     * Creates a new Portlet URL.
     */    
    EngineURL createURL(PortletRequest request, PortletResponse response, ObjectID pageOID,
            ObjectID layoutOID, Map actionParams, UrlType type) throws PortletException;    
    
    /**
     * Creates a new Portlet URL.
     */
    EngineURL createURL(PortletRequest request, PortletResponse response, String pageUniqueName,
            String layoutUniqueName, Map actionParams, UrlType type) throws PortletException;
    
    // --- Aggregated Portlet URLs ----------
    
    /**
     * Creates URL to specified page (with all aggregated portlets) 
     */
    EngineURL createPageUrl(PortletRequest request, PortletResponse response, String pageUniqueName) throws PortletException;
    
    /**
     * Creates URL to specified page (with all aggregated portlets) 
     */
    EngineURL createPageUrl(PortletRequest request, PortletResponse response, ObjectID pageID) throws PortletException;
    
    EngineURL createPageUrl(PortletRequest request, PortletResponse response, String pageUniqueName, String layoutUniqueName, String type, Map params) throws PortletException;
    
    EngineURL createPageUrl(PortletRequest request, PortletResponse response, ObjectID pageOID, ObjectID layoutOID, String type, Map params) throws PortletException;
}
